package iiris

import (
	"gitee.com/tietang/terrace-go/v2/base/starter/iweb"
	"github.com/kataras/iris/v12"
	"github.com/tietang/props/v3/kvs"
)

func healthAndInfoEndpoint(conf kvs.ConfigSource, app *iris.Application) {
	endpoint, handler := iweb.GetInfoHandler(conf)
	app.Get(endpoint, func(ctx iris.Context) {
		handler.ServeHTTP(ctx.ResponseWriter(), ctx.Request())
	})
	endpoint, handler = iweb.GetHealthHandler(conf)
	app.Get(endpoint, func(ctx iris.Context) {
		handler.ServeHTTP(ctx.ResponseWriter(), ctx.Request())
	})
}
